function [ setSegment ] = getSetSegmentOfCoordinate( set, coordinate )
%GETSETSEGMENTOFCOORDINATE Summary of this function goes here
%   Detailed explanation goes here

import	MatFile.*
import	FactorAdapter.*
import	FactorBase.*
import	BackTest.*
import	GUI.*
import	StrategyServer.*
import	DataBaseConn.*
import	xmlParsing.*
import  Bond.*

    [~,setIdxOfCoordinate] = ismember(set,coordinate);
    setIdxOfCoordinate = sort(setIdxOfCoordinate);
    len_setIdxOfCoordinate = length(setIdxOfCoordinate);
    if len_setIdxOfCoordinate > 0
        if len_setIdxOfCoordinate > 1
            segment = [0,find((setIdxOfCoordinate(2:end)-setIdxOfCoordinate(1:end-1))>1),length(setIdxOfCoordinate)];
        else
            segment = [0,length(setIdxOfCoordinate)];
        end
        len = length(segment);
        setSegment = cell(1,len-1);
        for i=2:len
            segmentTemp = setIdxOfCoordinate(segment(i-1)+1:segment(i));
            setSegment{i-1} = coordinate(segmentTemp);
        end
    else
        setSegment = {};
    end
end

